﻿using Microsoft.EntityFrameworkCore;
using Simple.Admin.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace Simple.Admin.EntityFrameworkCore.Repositories;

public class EfMenuEntityRepository : EfCoreRepository<AdminDbContext, MenuEntity, Guid>, IMenuEntityRepository
{
    public EfMenuEntityRepository(IDbContextProvider<AdminDbContext> dbContextProvider) : base(dbContextProvider)
    {
    }

    public async Task<List<MenuEntity>> GetChildrenAsync(Guid parentId)
    {
        var db =await GetDbSetAsync();
        var result= await db.Where(x => x.Id == parentId).ToListAsync();
        return result;
    }
}
